clear
capture log close
set more off
use Couples1960

keep statefip age race hispan educd incwage age_m agemarr agemarr_m marrno marrno_m hwage

replace incwage=incwage*172.2/29.6
replace hwage=hwage*172.2/29.6
gen white=(race==1&hispan==0)
gen black=(race==2&hispan==0)
gen hisp=(hispan!=0)
gen nohs=(educd<60)
gen hs=(educd>=60& educd<100)
gen coll=(educd==100)
gen adv=(educd>100)

gen agediff=age_m-age
gen pos=(agediff>0)
gen agediffpos=agediff*pos
gen agediffneg=agediff*(1-pos)*(-1)
gen ap1=(agediffpos>=2&agediffpos<=4)
gen ap2=(agediffpos>=5&agediffpos<=7)
gen ap3=(agediffpos>=8)
gen an1=(agediffneg>=2&agediffneg<=4)
gen an2=(agediffneg>=5&agediffneg<=7)
gen an3=(agediffneg>=8)

tab age, gen(wfe)
gen agehs=age*hs
tab agehs, gen(whsfe)
gen agecoll=age*coll
tab agecoll, gen(wcollfe)
gen ageadv=age*adv
tab ageadv, gen(wadvfe)
tab statefip, gen(stf)

keep if marrno==1
gen marr2=(marrno_m==2)
gen agem2=agemarr*agemarr

keep if hwage!=0
keep if hwage!=.

log using Tab3_women_1960_col3col4.log, replace

reg hwage ap1 ap2 ap3 an1 an2 an3 agemarr agem2 marr2 white black hisp stf* wfe* whsfe* wcollfe* wadvfe*, robust
tobit incwage ap1 ap2 ap3 an1 an2 an3 agemarr agem2 marr2 white black hisp stf* wfe* whsfe* wcollfe* wadvfe*, ll(0) robust

log close
